Skip to content

feat: ability to embed NativeScript into host Swift and Kotlin projects #5803

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Jul 11, 2024

Conversation

NathanWalker
Copy link
Contributor

@NathanWalker NathanWalker commented May 28, 2024

PR Checklist

What is the current behavior?

No easy way to embed NativeScript into host projects.

What is the new behavior?

You can use the cli to embed any project into Swift or Kotlin projects with the following:

ns embed ios /path/to/Swift/project

ns embed android /path/to/Kotlin/project <optional moduleName>

Also supported via nativescript.config.ts:

import { NativeScriptConfig } from "@nativescript/core";

export default {
  id: "org.nativescript.testembed",
  appPath: "app",
  appResourcesPath: "App_Resources",
  android: {
    v8Flags: "--expose_gc",
    markingMode: "none",
  },

  embed: {
    hostProjectPath: "./platforms/android",
    hostProjectModuleName: "TestEmbed",
    
    // or platform specific overrides:
    ios: {
      hostProjectPath: "./platforms/ios",
    },
    android: {
      hostProjectPath: "./platforms/android",
      hostProjectModuleName: "TestEmbed",
    },
  },
} as NativeScriptConfig;

@NathanWalker NathanWalker added this to the 8.8 milestone May 28, 2024
@cla-bot cla-bot bot added the cla: yes label May 28, 2024
@NathanWalker NathanWalker merged commit 42177c3 into main Jul 11, 2024
1 check passed
@NathanWalker NathanWalker deleted the embed branch July 11, 2024 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants